<!-- 功能：系统日志 | 作者：menghao.yan | 邮箱：yxs2615@163.com | 时间：2023年08月22日 23:03:26 -->
<template>
  <a-tabs v-model:activeKey="activeKey" type="card" class="y-tabs">
    <a-tab-pane :key="'kongzhiqi_'+ index" :tab="'控制器-'+index" v-for="index in 3">
      <a-row>
        <a-col :span="24">
          <a-button type="link" class="y-btn" @click="">
            <template #icon>
              <EyeOutlined />
            </template>
            查看保存的日志
          </a-button>
        </a-col>
      </a-row>

      <a-card>
        <a-row align="middle">
          <a-col :span="16">
            <a-space>
            </a-space>
          </a-col>
          <a-col :span="8">
            <a-input v-model:value="searchValue">
              <template #addonBefore>
                <search-outlined /> 搜索:
              </template>
            </a-input>
          </a-col>
        </a-row>
        <a-table bordered :data-source="dataSource" :columns="columns" class="y-table" :pagination="pagination">
          <template #bodyCell="{ text, column, record }">
            <template v-if="column.key === 'xiTongRiZhi'">
              <a-row align="middle">
                <a-col flex="auto">
                  <span>{{text}}</span>
                </a-col>
                <a-col flex="20px">
                  <a-space class="y-xiTongRiZhi-table-name">
                    <a-tooltip color="#2e6e9e" placement="right">
                      <template #title>下载系统日志</template>
                      <a-button type="link" @click="">
                        <template #icon>
                          <ArrowDownOutlined />
                        </template>
                      </a-button>
                    </a-tooltip>
                    <a-tooltip color="#2e6e9e" placement="right">
                      <template #title>删除</template>
                      <a-button type="link" @click="">
                        <template #icon>
                          <delete-outlined />
                        </template>
                      </a-button>
                    </a-tooltip>
                  </a-space>
                </a-col>
              </a-row>
            </template>
          </template>
        </a-table>
      </a-card>
    </a-tab-pane>
  </a-tabs>
</template>

<script setup>
const searchValue = ref('')


const visibleXinZengJingTaiLuYouModal = ref(false)

const openXinZengJingTaiLuYouModal = () => {
  visibleXinZengJingTaiLuYouModal.value = true
}

const activeKey = ref('kongzhiqi_1')

// 表格列
const columns = ref([
  {
    title: '系统日志',
    dataIndex: 'xiTongRiZhi',
    key: 'xiTongRiZhi',
    align: 'center',
    sorter: {
      compare: (a, b) => a.xiTongRiZhi.localeCompare(b.xiTongRiZhi),
      multiple: 1
    }
  }
])

// 表格数据
const dataSource = ref([
  {
    xiTongRiZhi: '2021-09-23 11:00:00'
  },
  {
    xiTongRiZhi: '2021-09-23 11:00:00'
  },
  {
    xiTongRiZhi: '2021-09-23 11:00:00'
  },
  {
    xiTongRiZhi: '2021-09-23 11:00:00'
  }
])

// 分页
const pagination = {
  current: 1,
  pageSize: 10,
  showQuickJumper: true,
  showSizeChanger: true,
  total: 0,
  showTotal: (total, range) => {
    return `${range[0]}-${range[1]} 共 ${total} 条数据`
  },
  onChange: (page, pageSize) => {
    console.log('系统日志>>', page, pageSize)
  }
}
</script>

<style scoped lang='scss'>
.ant-row {
  margin-bottom: 10px;
}
.y-xiTongRiZhi-table-name {
  color: #67c23a;
}
</style>